/**
 * 
 */
package com.nwpusp.controller.actions;

import android.util.Log;

import com.nwpusp.model.GameModel;
import com.nwpusp.model.StaticEntity;
import com.nwpusp.model.characters.GameCharacter;
import com.nwpusp.model.players.Player;
import com.nwpusp.model.props.Prop;
import com.nwpusp.model.session.ConnectionId;

/**
 * @author JustinCao
 *
 */
public class PropCollideAction extends CollideAction {

	public PropCollideAction(ConnectionId cid, StaticEntity ent) {
		super(cid, ent);
	}

	@Override
	public void Invoke(GameModel m) {
		Prop p = (Prop)this.ent;
		if(m.getScenario().isExist(p)) {
			Player player = m.getPlayerManager().getPlayer(cid);
			if(player != null) {
				p.Effect(player.getCh());
				m.getScenario().removeProp(ent.getStaticEntityId());
			}
		}
	}
}
